/* 
 * ViaturaServiceImpl.java
 * 
 * Data de criação: 15/09/2010
 * 
 * CORPORATIVO - MTE. 
 *
 */
package br.com.o2solutions.siso.service.impl;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import br.com.o2solutions.core.business.BasicBusiness;
import br.com.o2solutions.core.exception.BusinessException;
import br.com.o2solutions.core.service.ServiceSupport;
import br.com.o2solutions.siso.business.impl.TipoViaturaBusinessImpl;
import br.com.o2solutions.siso.integration.entidade.TipoViatura;
import br.com.o2solutions.siso.integration.entidade.Viatura;
import br.com.o2solutions.siso.service.ViaturaService;

/**
 * Classe responsável por implementar os serviços relacionados as viaturas.
 * 
 * @author Osvaldeir
 * @since 15/09/2010
 * 
 */
@Service("viaturaService")
public class ViaturaServiceImpl extends
		ServiceSupport<Viatura, BasicBusiness<Viatura>> implements ViaturaService{

	private static final long serialVersionUID = 3036388618748960188L;

	
	@Value("#{tipoViaturaBusiness}")
	private TipoViaturaBusinessImpl  tipoViaturaBusiness;
	
	@Override
	@Value("#{viaturaBusiness}")
	public void setBusinessObject(BasicBusiness<Viatura> businessObject) {
		super.setBusinessObject(businessObject);
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public void save(Viatura entity) throws BusinessException {
		getBusinessObject().save(entity);
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public void remove(Viatura entity) throws BusinessException {
		getBusinessObject().remove(entity);
	}

	@Override
	public void saveTipoViatura(TipoViatura tipoViatura)
			throws BusinessException {
		tipoViaturaBusiness.save(tipoViatura);
		
	}
}
